The present disclosure relates to an image reading device and an image forming apparatus.
In a conventional image reading device, in preparation for document reading, by a user, a document as a reading target is placed on a document stage, and the document placed on the document stage is held by a document cover. Then, when reading the document placed on the document stage, the image reading device radiates light toward the document stage, focuses the light reflected from the document and from the document cover on an image sensor, and generates image data based on an analog signal output from the image sensor.
The image data (read image data) generated as described above includes image data of the document and image data of the document cover. Thus, to extract only the image data of the document from the read image data, size detection of the document (document edge detection) is often performed based on the read image data. For example, in one conventional configuration, an edge of a document is detected by discriminating, from the read image data, black lines (lines of pixels corresponding to a shadow) that appear as a result of a shadow cast in the vicinity of an edge of the document being read.